# fromkeys方法: 根据key创建value为空的字典

emptyDict = {}.fromkeys(['name', 'age', 'house'])
print(emptyDict)
# {'name': None, 'age': None, 'house': None}

# get
dictA = {
  'name': 'Alex',
  'age': 18,
  'hosue': 'Haikou'
}

print(dictA.get('name'))
print(dictA.get('car'))
print(dictA.get('car'), 'Benz')
# Alex
# None
# None Benz